package point

import (
	"dev_gw/common"
	"fmt"

	"github.com/spf13/viper"
)

type SnPoint struct{}

func NewSnPoint() *SnPoint { return &SnPoint{} }

func (s *SnPoint) Get() any {

	v := viper.New()
	v.SetConfigName("config")
	v.SetConfigType("yaml")
	v.AddConfigPath(common.ConfigFilePath)
	err := v.ReadInConfig()
	if err != nil {
		fmt.Println("read config file failed, err -->", err)
		return "12345678900987654321"
	}

	sn := v.GetString("sn")
	return sn

}

func (s *SnPoint) Set(...any) bool { return false }

func (s *SnPoint) SetRoute(string) PointInterface { return s }
